package com.qd.common.panda.domain.entity.card;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 卡卷分享明细
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class CardInfoShareDetailDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "分享ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "分享ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String shareId;
    /**
     * 卡卷ID
     */
    @NotBlank(message = "卡卷ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "卡卷ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String cardId;
    /**
     * 分享人ID
     */
    @NotBlank(message = "分享人ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "分享人ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String shareUserId;
    /**
     * 分享人手机号
     */
    @NotBlank(message = "分享人手机号不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "分享人手机号长度不能超过{max}位", groups = DefaultGroup.class)
    private String shareMobile;
    /**
     * 领取人ID
     */
    @Size(max = 50, message = "领取人ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String receivedUserId;
    /**
     * 领取人手机号
     */
    @Size(max = 20, message = "领取人手机号长度不能超过{max}位", groups = DefaultGroup.class)
    private String receivedMobile;
    /**
     * 分享时间
     */
    @NotNull(message = "分享时间不能为空", groups = DefaultGroup.class)
    private LocalDateTime shareTime;
    /**
     * 领取时间
     */
    private LocalDateTime receivedTime;
    /**
     * 计划ID
     */
    @NotBlank(message = "计划ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "计划ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String planId;
    /**
     * 卷信息
     */
    @NotBlank(message = "卷信息不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "卷信息长度不能超过{max}位", groups = DefaultGroup.class)
    private String cardMsgId;

    @Override
    public void freeData() {
        this.shareId = null;
        this.cardId = null;
        this.shareUserId = null;
        this.shareMobile = null;
        this.receivedUserId = null;
        this.receivedMobile = null;
        this.shareTime = null;
        this.receivedTime = null;
        this.planId = null;
        this.cardMsgId = null;
        super.freeData();
    }
}
